package com.farproc.bugreporter.test;


import com.farproc.android.BugReporter;

import android.app.Application;
import android.content.Context;
import android.content.SharedPreferences;


public class MyApplication extends Application {
	
	public static final String PREFERENCE_NAME = "pref";
	public static final String KEY_PROMPT_WHEN_CAUGHT = "prompt_when_caught";
	public static final String KEY_PROMPT_AT_STARTUP = "prompt_at_start_up";
	
	@Override
	public void onCreate() {
		super.onCreate();
		
		final SharedPreferences pref = getSharedPreferences(PREFERENCE_NAME, Context.MODE_PRIVATE);
		final boolean promptWhenCaught = pref.getBoolean(KEY_PROMPT_WHEN_CAUGHT, false);
		BugReporter.setupMonitor(this, "your email address", null, 
				promptWhenCaught ? PromptToInstall.class : null);
	}
}
